#!/bin/bash

dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source "${dir}/helpers.bash"
# dir might have been overwritten by helpers.bash
dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

function copy_runtime_test_files {
  local VM=$(get_cilium_master_vm_name)
  local RUNTIME_TESTS_DIR="tests/${CILIUM_FILES}"

  copy_files_vm ${VM} ${RUNTIME_TESTS_DIR}

  # BUILD_ID is generated in helpers.bash.
  echo "----- creating a tarball of files copied from $VM -----"
  sudo tar -czvf ${CILIUM_FILES}-runtime-${BUILD_ID}.tar.gz ${CILIUM_FILES}-${VM}
  echo "----- done creating a tarball of files copied from $VM -----"
}

copy_runtime_test_files
